package com.wallet.crypto.trustapp.ui.setting;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.wallet.crypto.trustapp.R;
import com.wallet.crypto.trustapp.ui.BaseActivity;
import com.wallet.crypto.trustapp.util.Loger;

public class ChangeNameActivity extends BaseActivity {

    private ImageView mClose;
    private TextView mTitle;
    private EditText mEditText;
    private Button mSave;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_change_user_name);
        initView();
    }

    private void initView() {
        mClose = findViewById(R.id.top_icon);
        mTitle = findViewById(R.id.top_title);
        mTitle.setVisibility(View.VISIBLE);
        mTitle.setText(R.string.s0023);
        mEditText = findViewById(R.id.user_name);
        mSave = findViewById(R.id.save_data);
        mSave.setOnClickListener(this::OnSaveUserNameListener);
        mClose.setOnClickListener(this::OnCloseListener);
    }

    private void OnSaveUserNameListener(View view) {
        Loger.e(" 保存的名称为 "+ mEditText.getText().toString().trim());
        finish();
    }

    private void OnCloseListener(View view) {
        finish();
    }
}
